package com.baizhi.cmfz.service.impl;

import com.baizhi.cmfz.dao.AlbumDao;
import com.baizhi.cmfz.entity.Album;
import com.baizhi.cmfz.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class AlbumServiceImpl implements AlbumService {
    @Autowired(required = false)
    private AlbumDao albumDao;
    @Override
    @Transactional
    public List<Album> selectNewAlbum(int count) {
        //查询出来6条最近的专辑
        List<Album> albums = albumDao.selectNewAlbum(count);
        return albums;
    }

    @Override
    @Transactional
    public List<Album> selectAllAlbum() {
        return albumDao.selectAllAlbum();
    }

    @Override
    @Transactional
    public Album selectOneAlbum(int albumId) {
        return albumDao.selectOneAlbum(albumId);
    }
}
